<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8"/>
</head>
<body>
	<div id="moduleHtml">
	 <div id="titlebarContainter">
		  <div id="titlebarStart">开始按钮</div>
		  <div id="titlebarSearch">搜索框</div>
		  <div id="titlebarUser">用户面板</div>
	  </div>
	</div>
</body>
  <script>
  //cofit_module_js
    Cofit.moduleSourceCode.title_bar=function(dom){
      var module = {
        dom : $(dom) ,        
        //显示
        show : function(){
	          var dom=$(module.dom);
	          $("body").append(dom);
	          $(window).resize(module.resize);
	          var containter=dom.find("#titlebarContainter");
	          containter.css("top",-containter.height()+"px");
	          module.resize();
	          containter.animate( { top: 0}, "slow",function(){
	        	  module.resize();
         	  });
        },
        //跟随窗口尺寸        
        resize : function(){
          var dom=$(module.dom);
          var containter=dom.find("#titlebarContainter");
          containter.width( $(window).width() );
          var searchWidth=$(window).width()-
	          dom.find("#titlebarStart").width()-
	          dom.find("#titlebarUser").width();
          dom.find("#titlebarSearch").width(searchWidth);
        }
      };
      return module;
    };
  //cofit_module_js
  </script>
</html>